import api from '../../fetch/api'
import * as types from '../mutation-types';

const state = {
    process:[]
}

const actions = {
    getProcess({ commit }, param) {
        api.get_process(param).then(res => {
            commit(types.GET_PROCESS, res)
        })
    },
    getTitle({ commit }, title) {
        commit('getTitle',title)
    }
}

const getters = {
    process: state => state.process,
}

const mutations = {
    [types.GET_PROCESS](state, res) {
        state.process = res.data
    },
    getTitle(state, payload) {
        state.process.title=payload
    }
}

export default {
    state,
    actions,
    getters,
    mutations,
}